package langchain4j.assistant;

import dev.langchain4j.service.*;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

//@AiService(
//        wiringMode = EXPLICIT,
//        chatModel = "qwenChatModel",
//        chatMemoryProvider = "chatMemoryProviderXiaozhi",
//        tools = "appointmentTools",
//        contentRetriever = "contentRetrieverXiaozhi" //配置向量存储
//)
//声明这是一个 AI 智能体
@AiService(                     //AUTOMATIC-自动注入依赖(装配模式)：框架自动查找并注入所需的依赖（如模型、工具等）。
        wiringMode = EXPLICIT,  //EXPLICIT-显示注入依赖 :强制要求开发者手动指定所有依赖（避免隐式注入）。
        streamingChatModel = "qwenStreamingChatModel",      //模型名称
        chatMemoryProvider = "chatMemoryProviderXiaozhi",   //持久化数据通过MongoDB
        tools = "appointmentTools",     //预约取消预约等bean
        contentRetriever = "contentRetrieverXiaozhiPincone")    // 用于知识库语义搜索，相似度阈值0.8
public interface XiaozhiAgent {

    //fromResource-从文件加载系统提示词
    @SystemMessage(fromResource = "zhaozhi-prompt-template.txt")
    Flux<String> chat(@MemoryId Long memoryId, @UserMessage String userMessage);
}